<?php

//Coded by Jonathan Gorard, 2012
//Part of The Matrix Unplugged, All Rights Reserved

	$macropage="missions.php";
	include "globals.php";
	
	if($ir['jail'] or $ir['hospital']) {
		die("This page cannot be accessed while in Jail or Reconstruction.");
	}

	$q2=$db->query("SELECT * FROM crimes ORDER BY crimeBRAVE ASC");
	while ($r2=$db->fetch_row($q2)){
		$crimes[]=$r2;
	}

	$q=$db->query("SELECT * FROM crimegroups ORDER by cgORDER ASC");
	print "<b>Mission Centre</b><br /><br />
Please note that your Mission success depends on both your level and your stats (relevant to the mission). For instance, if you're attempting a Combat Mission, try raising your Combat skill in the Training Area first, or you may risk going to jail.<br /><br />
<table width='75%' cellspacing=1 class='table'><tr><th>Mission</th><th>Cost</th><th>Do</th></tr>";
	while($r=$db->fetch_row($q)){
		print "<tr><td colspan='3' class='h'>{$r['cgNAME']}

	</td></tr>";
	foreach($crimes as $v){
		
		if($v['crimeGROUP'] == $r['cgID']){
			print "<tr><td>{$v['crimeNAME']}

		</td><td>{$v['crimeBRAVE']}

	 Stamina</td><td><a href='domission.php?c={$v['crimeID']}

'>Do</a></td></tr>";
}

}

}

print "</table>";
$h->endpage();
?>